<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('订单列表')"/>
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="formId">
                <div class="select-list">
                    <input type="hidden" name="orderType" th:value="${orderType}"/>

                    <ul>
                        <li>
                            单号：<input type="text" name="orderCode"/>
                        </li>

                        <li>
                            时间：<input type="text" name="orderTime"/>
                        </li>

                        <li>
                            经手人：<input type="text" name="createBy"/>
                        </li>


                        <!--<li>
                            出库类型：<input type="text" name="outputType"/>
                        </li>

                        <li>
                            0：默认 1：执行中 2：已完成：<input type="text" name="status"/>
                        </li>

                        <li>
                            创建时间：<input type="text" name="createTime"/>
                        </li>

                        <li>
                            备注：<input type="text" name="remark"/>
                        </li>-->

                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
                                    class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
                                    class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>

        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table" data-mobile-responsive="true"></table>
        </div>
    </div>
</div>
<div th:include="include :: footer"></div>
<script th:inline="javascript">
    var editFlag = [[${@permission.hasPermi('system:ncOrder:edit')}]];
    var removeFlag = [[${@permission.hasPermi('system:ncOrder:remove')}]];
    var prefix = ctx + "system/ncOrder";
    var orderType = [[${orderType}]];
    $(function () {
        var options = {
            url: prefix + "/list",
            createUrl: prefix + "/add?orderType=" + orderType,
            updateUrl: prefix + "/edit/{id}",
            removeUrl: prefix + "/remove",
            exportUrl: prefix + "/export",
            modalName: "订单",
            showExport: false,
            columns: [{
                checkbox: true
            },
                {
                    field: 'orderId',
                    title: '单子id',
                    visible: false
                },
                {
                    field: 'orderCode',
                    title: '单号',
                    sortable: true
                },
                /*{
                    field: 'orderTime',
                    title: '时间',
                    sortable: true
                },*/
                {
                    field: 'createTime',
                    title: '时间',
                    sortable: true
                },
                {
                    field: 'createBy',
                    title: '经手人',
                    sortable: true
                },
                /*{

                    field: 'outputType',
                    title: '出库类型',
                    sortable: true
                },
                {
                    field: 'status',
                    title: '状态',
                    sortable: true
                },*/
                {
                    field: 'remark',
                    title: '备注',
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function (value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-primary btn-xs " href="javascript:void(0)" onclick="showOrderInfo(\'' + row.orderId + '\')"><i class="fa fa-info"></i>预览</a> ');
                        return actions.join('');
                    }
                }]
        };
        $.table.init(options);


    });

    /*查看订单详情列表*/
    function showOrderInfo(id) {
        var url = prefix + "/zhibaoOrderDetail?orderId=" + id
        $.modal.openTab("订单详情", url);
    }
</script>
</body>
</html>